package cn.tedu.spring.life;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ServiceConfig {
    /**
     * initMethod 初始化方法 等同于@PostConstruct
     * destroyMethod 自定义销毁方法，等同于@PreDestroy
     * @return
     */
    @Bean(initMethod = "init",destroyMethod = "destroy")
    public CategoryService categoryService(){
        return new CategoryService();
    }
}
